﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.MacroEngines;

namespace Eksponent.RazorRocks.Umbraco.DynamicNodeSettings
{
    /// <summary>
    /// A convenient alias for RazorRocks&lt;DynamicNode&gt;
    /// </summary>
    public class RazorRocks : RazorRocks<DynamicNode>
    {        
        public static void ConfigureTemplates(Action<TemplateMatcher<DynamicNode>.ConfigSetter> actions,
            bool reload = false)
        {
            ConfigureTemplates(actions, reload, ()=>new DynamicNode(umbraco.NodeFactory.Node.GetCurrent()), n=>n.NodeTypeAlias);
        }
    }

    public static class RazorRocksDynamicNodeExtensions
    {
        public static TemplateHelperResult Render(this DynamicNode node, params object[] data)
        {
            return RazorRocks.Render(node, data);
        }

        public static TemplateHelperResult RenderWith(this DynamicNode node, TemplateAction<DynamicNode> action, object args = null)
        {
            return RazorRocks.RenderWith(node, action, args);
        }
    }
}
